struct Solution {}

fn main() {}

impl Solution {
    pub fn find_max_consecutive_ones(nums: Vec<i32>) -> i32 {
        let mut max_cnt = 0;
        let mut cur_cnt = 0;
        for num in nums {
            match num {
                1 => {
                    cur_cnt += 1;
                    if cur_cnt > max_cnt {
                        max_cnt = cur_cnt;
                    }
                }
                0 => {
                    cur_cnt = 0;
                }
                _ => {
                    panic!();
                }
            }
        }
        return max_cnt;
    }
}
